<?php 
require_once 'config.php';
if(!$loggedIn){
	header('Location:login.php') ;
	exit();
}
$img = mysql_escape_string($_POST['image']);
$icon_x = mysql_escape_string($_POST['icon_x']);
$icon_y = mysql_escape_string($_POST['icon_y']);
$icon_width = 64;
$icon_height = 64;
$icon_name = mysql_escape_string($_POST['icon_name']);

mysql_query("INSERT INTO te_icon (icon_theme,icon_image,icon_x,icon_y,icon_width,icon_height,icon_name) VALUES ($themeId,'$img','$icon_x','$icon_y','$icon_width','$icon_height','$icon_name')");
echo mysql_insert_id();
?>